function createUploader(MODULE, callback) {
    let uploader = new AliyunUpload.Vod({
        timeout: 60000,
        partSize: 1048576,
        parallel: 5,
        retryCount: 3,
        retryDuration: 2,
        region: 'cn-shanghai',
        userId: 1878405246559035,
        // 添加文件成功
        addFileSuccess: function (uploadInfo) {
            console.log("addFileSuccess: " + uploadInfo.file.name)
            setTimeout(() => uploader.startUpload(), 200)
        },
        // 开始上传
        onUploadstarted: function (uploadInfo) {
            api.showProgress({
                title: '小蟹上传中...',
                text:'',
                modal:  true
            });
            
            if (!uploadInfo.videoId) {
                common('getVideoAuth')(uploadInfo.file.name, MODULE, (ret) => {
                    if (ret && ret.code === RESPONSE_OK) {
                        const uploadAuth = ret.data.uploadAuth;
                        const uploadAddress = ret.data.uploadAddress;
                        const videoId = ret.data.videoId;
                        uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)
                        console.log("onUploadStarted:" + uploadInfo.file.name + ", endpoint:" + uploadInfo.endpoint + ", bucket:" + uploadInfo.bucket + ", object:" + uploadInfo.object)
                    } else {
                        toastBottom(ret ? ret.msg : '')
                    }
                })
            } else {
                // 如果videoId有值，根据videoId刷新上传凭证
                common('refreshVideoAuth')(uploadInfo.videoId, (ret) => {
                    const uploadAuth = ret.data.uploadAuth;
                    const uploadAddress = ret.data.uploadAddress;
                    const videoId = ret.data.videoId;
                    uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)
                })
            }
        },
        // 文件上传成功
        onUploadSucceed: function (uploadInfo) {
            callback(uploadInfo)
        },
        // 文件上传失败
        onUploadFailed: function (uploadInfo, code, message) {
            console.log("onUploadFailed: file:" + uploadInfo.file.name +
                ",code:" + code +
                ", message:" +
                message)
        },
        // 取消文件上传
        onUploadCanceled: function (uploadInfo, code, message) {
            console.log("Canceled file: " + uploadInfo.file.name + ", code: " + code + ", message:" + message)
        },
        // 文件上传进度，单位：字节, 可以在这个函数中拿到上传进度并显示在页面上
        // onUploadProgress: function (uploadInfo, totalSize, progress) {
        //     console.log("onUploadProgress:file:" + uploadInfo.file.name + ", fileSize:" + totalSize + ", percent:" + Math.ceil(progress * 100) + "%")
        //     var progressPercent = Math.ceil(progress * 100)
        // },
        // 上传凭证超时
        onUploadTokenExpired: function (uploadInfo) {
            common('refreshVideoAuth')(uploadInfo.videoId, (ret) => {
                const uploadAuth = ret.data.uploadAuth;
                uploader.resumeUploadWithAuth(uploadAuth)
                console.log('upload expired and resume upload with uploadauth ' + uploadAuth)
            })
            console.log('上传超时')
        },
        // 全部文件上传结束
        onUploadEnd: function (uploadInfo) {
            api.hideProgress();
            console.log("onUploadEnd: uploaded all the files")
        }
    })
    return uploader
}
